import 'package:flutter_module/tabbar/shop/shopModel.dart';

class AreaModel {
  String id;
  String uuid;
  String parentId;
  Context context;
  bool hasChildren;
  List<AreaModel> children = [];
  List<ShopModel> shops = [];

  AreaModel(
      {this.id,
      this.uuid,
      this.parentId,
      this.context,
      this.hasChildren,
      this.children});

  AreaModel.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    uuid = json['uuid'];
    parentId = json['parentId'];
    context =
        json['context'] != null ? new Context.fromJson(json['context']) : null;
    hasChildren = json['hasChildren'];
    
  }

}

class Context {
  String id;
  int createdTime;
  String creator;
  int modifiedTime;
  String modifier;
  bool logicalDelete;
  String version;
  String uuid;
  String enterpriseId;
  String name;
  String code;
  String parentId;

  Context(
      {this.id,
      this.createdTime,
      this.creator,
      this.modifiedTime,
      this.modifier,
      this.logicalDelete,
      this.version,
      this.uuid,
      this.enterpriseId,
      this.name,
      this.code,
      this.parentId});

  Context.fromJson(Map<String, dynamic> json) {
    id = json['id'];
    createdTime = json['createdTime'];
    creator = json['creator'];
    modifiedTime = json['modifiedTime'];
    modifier = json['modifier'];
    logicalDelete = json['logicalDelete'];
    version = json['version'];
    uuid = json['uuid'];
    enterpriseId = json['enterpriseId'];
    name = json['name'];
    code = json['code'];
    parentId = json['parentId'];
  }
}

